package com.supcon.exchangedata.repository.slave5;

import com.supcon.exchangedata.pojo.entity.mysql.operation.rq.GasLiquidInfo;
import com.supcon.exchangedata.pojo.entity.mysql.operation.rq.GasNaturalInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;


public interface SlaveGasNaturalInfo extends JpaRepository<GasNaturalInfo, Long> {
    List<GasNaturalInfo> findAll();


    @Transactional
    @Query(nativeQuery = true, value = "SELECT * FROM gas_natural_daily_operation_info WHERE day = ?1")
    GasNaturalInfo findByDay(String day);

    GasNaturalInfo findByDataTime(LocalDateTime dataTime);

}
